package com.alibaba.demo.service.gateway;

import com.alibaba.demo.domain.service.entity.IotServiceEntity;
import com.alibaba.demo.domain.service.gateway.IotServiceGateway;
import com.alibaba.demo.service.convertor.IotServiceConvertor;
import com.alibaba.demo.service.dataobject.IotServiceDO;
import com.alibaba.demo.service.mapper.IotServiceMapper;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author Administrator
 * @date 2024/4/28 10:10
 * @description
 */
@Component
public class IotServiceGatewayImpl implements IotServiceGateway {
    @Resource
    private IotServiceMapper iotServiceMapper;

    @Override
    public IotServiceEntity save(IotServiceEntity iotServiceEntity) {
        IotServiceDO iotServiceDO = IotServiceConvertor.toDO(iotServiceEntity);
        iotServiceMapper.insert(iotServiceDO);
        return IotServiceConvertor.toEntity(iotServiceDO);
    }
}
